<template>
  <div class="header-wrapper">
    <img src="@/assets/img/logo.png" alt="">
    <el-space>
      <i class="el-icon-bell font-20"></i>
      <el-avatar :size="40" :src="src">{{src ? null: user.username}}</el-avatar>
      <span>{{user.username}}</span>
    </el-space>
  </div>
</template>

<script lang="ts">
  import { defineComponent } from "vue"
  import useAuth from "../composables/user"
  export default defineComponent({
    props: {
      src: {
        type: String,
        default: ''
      }
    },
    setup() {
      const { user } = useAuth()
      return {
        user
      }
    }
  })
</script>

<style lang="scss" scoped>
.header-wrapper {
  display: flex;
  justify-content: space-between;
  height: 72px;
  padding: 20px;
  background: #fff;
  box-sizing: border-box;
}
</style>
